<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>卖家-修改个人信息</title>
<link href="<?php echo $this->_webroot('/user/css/common.css'); ?>" rel="stylesheet" type="text/css" />
<link href="<?php echo $this->_webroot('/user/css/content1.css'); ?>" rel="stylesheet" type="text/css" />
<script src="<?php echo $this->_webroot('/user/js/jquery-1.7.1.min.js'); ?>" type="text/javascript"></script>
<script src="<?php echo $this->_webroot('/user/js/common.js'); ?>" type="text/javascript"></script>

<style type="text/css">
.edit span{background:#FFF2E6;}
.search {margin:5px; height:30px; background:#fff; width:90%; padding-left:0px; text-align:left;}
.search input {color:#444;}
td{text-align:left;}
td div.goodsname{line-height:18px;  font-weight:bold;}
td span.category{color:#FF6600;}
</style>
 
</head>
<body>
<psp:tags     htmlname='user_topnav1'  iconname='usertopnav1' />
<psp:tags     htmlname='user_topsearch'  iconname='usertopsearch' />

<div class="main">
	<div class="main-left">
    	<div class="title">会员管理中心</div>
        <psp:tags     htmlname='user_menulist'  iconname='usermenulist' />
    </div>
<link href="<?php echo $this->_webroot('/user/css/shoprequest.css'); ?>" rel="stylesheet" type="text/css" />   
    <div class="main-right main_right">
	

            <div class="cont">            
                <div class="cont_title">
					<span class="tr_op">
					<a href="<?php echo $this->_url('supplier/index');?>">切换供货商</a>
					<a href="<?php echo $this->_url('supplier/goods/?id='.$onesupplier['supplier']['sup_user_id']);?>">返回上一层</a>
					</span>
					供货商[<?php echo $onesupplier['supplier']['sup_name']; ?>]的进货蓝
				</div>
			<form action="<?php echo $this->_url('supplier/dogoodsstock/');?>" method="post" onsubmit="return submitform();">
				<table width="100%" class="">
                    <tr class="">
						<th width="40"><input type="checkbox" onclick="checkall(this)" value="" name="c"></th>
						<th width="82"></th>
						<th>商品信息</th>
						<th width="130" align="left">销售价格/库存量</th>					
						<th width="55">进货价格</th>
						<th width="50">进货量</th>

						<th width="80" align="center">操作</th>
				   </tr>
					<?php 
					if(!empty($result['data'])) {
						foreach($result['data'] as $v) { ?>
					<tr class="trcolor">
						<td class="center" width="40">
						    <input type="checkbox" name="checkbox[]" value="<?php echo  $v['id'];?>" />				
						</td>
						<td class="center"><a href="<?php echo $this->_url('shop/productshow/'.$v['id']);?>" target="_blank"><img src="<?php echo $v['goods_thumb']; ?>" width="80" height="80" onerror="this.src='<?php echo $this->_webroot('user/images/nopic.gif'); ?>'"/></a></td>
						<td align="left" valign="top">
							<div class="goodsname"><a href="<?php echo $this->_url('shop/productshow/'.$v['id']);?>" target="_blank"><?php echo  $v['goods_name'];?></a></div>
							自定义分类：<span class="category"><?php if(isset($shop_category_info[$v['ucat_id']])){?><?php echo $shop_category_info[$v['ucat_id']];?><?php  } else {?>未定义<?php }?></span> &nbsp;<?php if($v['lock_flg']>0) {?><span color="red">锁定</span><?php }?> <br />
							<?php if($v['lock_flg']==0) {?>
							精品:<?php if($v['is_best']){?><img src="<?php echo $this->_webroot('user/images/yes.gif'); ?>" /><?php  } else {?><img src="<?php echo $this->_webroot('user/images/no.gif'); ?>"  /><?php }?> &nbsp;
							特价:<?php if($v['is_promote']){?><img src="<?php echo $this->_webroot('user/images/yes.gif'); ?>" /><?php  } else {?><img src="<?php echo $this->_webroot('user/images/no.gif'); ?>" /><?php }?> &nbsp;
							新品:<?php if($v['is_new']) {?><img src="<?php echo $this->_webroot('user/images/yes.gif'); ?>"  /><?php  } else {?><img src="<?php echo $this->_webroot('user/images/no.gif'); ?>" /><?php }?> &nbsp;
							<br/>热销:<?php if($v['is_hot']) {?><img src="<?php echo $this->_webroot('user/images/yes.gif'); ?>" /><?php  } else {?><img src="<?php echo $this->_webroot('user/images/no.gif'); ?>" /><?php }?> &nbsp;
							上架:<?php if($v['is_on_sale']) {?><img src="<?php echo $this->_webroot('user/images/yes.gif'); ?>" /><?php  } else {?><img src="<?php echo $this->_webroot('user/images/no.gif'); ?>" /><?php }?>
							<?php }?>
						</td>
						<td align="left" >￥<?php echo  $v['goods_price'];?>元&nbsp;/&nbsp;<?php echo  $v['goods_number'];?></td>
						<td style="text-align:center;" ><input style="width:40px" name="data[<?php echo  $v['id'];?>][jprice]" type="text" id="jprice_<?php echo  $v['id'];?>" value="<?php echo  $v['jprice'];?>"  maxlength="25" /></td>
						<td style="text-align:center;" ><input style="width:40px" name="data[<?php echo  $v['id'];?>][jnum]" type="text" id="jnum_<?php echo  $v['id'];?>" value="<?php echo  $v['jnumber'];?>"  maxlength="10" /></td>
						<td style="text-align:center;">
							<?php if($v['lock_flg']==0) {?>
							<a href="javascript:addCart(<?php echo  $v['id'];?>);" >进货</a><br/>
							<a href="<?php echo $this->_url('supplier/delstock/?id='.$v['id'].'&supuserid='.$onesupplier['supplier']['sup_user_id']);?>" >删除</a>							
							<?php } ?>
						</td>
					</tr>
					<?php }?>
                    <tr><td class="page" colspan="7">
					<a href="<?php  echo $result['page']['prevPage'] ; ?>" class="upPage">上一页</a>
					<a href="#" class="now"><?php  echo $result['page']['current']['num'] ; ?></a>
					<a href="<?php  echo $result['page']['nextPage'] ; ?>" class="nextPage">下一页</a>
                    </td></tr>
					<tr><td colspan="7">
					    <input type="hidden" name="supuserid" value="<?php echo $onesupplier['supplier']['sup_user_id'] ;?>" />
						<input class="submit" type="submit" name="up" value="批量进货" />
					</td></tr>
					<?php  } else {?>
					<tr><td colspan="7" class="center">暂无信息</td></tr>
					<?php }?>
				</table>
			</form>
					  		  
            </div>
    </div>
    <div class="clear"></div>
</div>

<div class="footer">
    <psp:tags     htmlname='user_footer_helper'  iconname='userfooterhelper' />

</div>

<script language="JavaScript" src="<?php echo $this->_webroot('servtools/ajax_client/ajax.js');?>"></script>
<script language="JavaScript">
<!--
var inputs = document.getElementsByTagName("input");
function submitform() {
	var status = document.getElementsByName("checkbox");
	var checknum = 0;
	for(var i=0; i<inputs.length; i++) {
		if(inputs[i].type=='checkbox') {
			if(inputs[i].checked) {
				checknum++;
			}
		}
	}
	if(checknum==0) {
		alert("致少要选择一项，才能进行操作！");
		return false;
	}
	return true;
}

function checkall(obj) {
	if(obj.checked) {
		for(var i=0; i<inputs.length; i++) {
			if(inputs[i].type=='checkbox') {
				inputs[i].checked = true;
			}
		}
	} else {
		for(var i=0; i<inputs.length; i++) {
			if(inputs[i].type=='checkbox') {
				inputs[i].checked = false;
			}
		}
	}
}
		function addCart(id) {
			var num = document.getElementById('jnum_'+id);
			var jprice = document.getElementById('jprice_'+id);		
			var num_reg = /^(\d+)$/;
			if(!num_reg.test(num.value)){
				alert('进货数量格式不正确!');
				return;
			}
			if(num.value=='0'){
				alert('进货数量不能为0！');
				return;
			}
	        document.location.href = "<?php echo $this->_url('supplier/getgoodsstock/?supid='.$onesupplier['supplier']['sup_user_id']);?>&id="+id+"&num="+num.value+"&jprice="+jprice.value;
		}
//-->
</script>
</body>
</html>